//数据库模块引入
const mysql = require('mysql');

//配置mysql链接信息
let con = mysql.createConnection({
    host:'localhost',
    port:3306,
    user:'root',
    password:'root',
    database:'day14homework',
})

//链接mysql
con.connect();

//运行sql语句
let s =  con.query('select xh,xm from xsb',(err,result)=>{
    console.log(err,result);
})

console.log(s);

